

import {
  SET_USER,
  SET_TOKEN,
  REMOVE_TOKEN,
  REMOVE_USER
} from './mutation-types'


export default {
  // 设置用户信息
  [SET_USER](state, user) {
    state.user = user
  },
  // 设置token
  [SET_TOKEN](state, token) {
    state.token = token
  },
  // 删除token
  [REMOVE_TOKEN](state) {
    state.token = ''
  },
  // 删除用户信息
  [REMOVE_USER](state) {
    state.user = {}
  },

}